#ifndef NET_CONNECTION_HPP
#define NET_CONNECTION_HPP

#include <SFML/Network.hpp>
#include <Vector>

using namespace std;

class Net_Connection
{
public:
    void connect(sf::IPAddress Ip, sf::Uint16 port);

    void move(float x, float y);
    void rotate(float angle);

    void receive();

    sf::Vector2f pos;
    sf::Vector2f velocity;
    float angle;

    sf::Int32 GetPid();

    vector<class ClientPlayer> GetClients();
private:
    sf::SocketTCP Sock;
    sf::Int32 pid;
    bool update_required;

    sf::Clock wait;

    vector<class ClientPlayer> clients;

    void RemoveFromVector(sf::Int32 pid);
    ClientPlayer& GetClientPlayerByPid(sf::Int32 pid);
};

#endif
